package logging

import (
	"log"
	"time"

	"shorten/pkg/file"
	"shorten/pkg/setting"
)

// InitLog 简单初始化日志
func InitLog(cfg *setting.LogSettingsS) (err error) {
	outfile, err := file.MustOpen(time.Now().Format("20060102")+cfg.FileExt, cfg.SavePath)
	if err == nil {
		log.SetOutput(outfile)
	}
	return
}
